Compression and decompression of data using plane equations

ABSTRACT

The present invention provides a scheme for compressing and decompressing the depth, or Z, components of image data. Image data is grouped into a plurality of tiles. A test is performed to determine if a tile can be compressed so that its size after compression is less than its size before compression. If so, the tile is compressed. A tile table includes a flag that can be set for each tile that is compressed. In one scheme, each tile comprises a 4×4 block of pixels. For each pixel, the visible depth complexity is determined where each visible level of depth complexity is represented by a plane equation. Depending on the depth complexity, a compression scheme is chosen that stores multiple plane equations in cache lines. The compression scheme can be used with unsampled or multisampled data and provides higher levels of compression in multisampled environments.

RELATED CO-PENDING APPLICATION

This application is a continuation of U.S. application Ser. No.10/293,003, filed Nov. 13, 2002, entitled “COMPRESSION AND DECOMPRESSIONOF DATA USING PLANE EQUATIONS”, having as inventors Timothy Van Hook etal., now issued as U.S. Pat. No. 7,242,400 and owned by instant assigneeand is incorporated herein by reference.

FIELD OF THE INVENTION

This invention relates to the field of image data compression.

Portions of the disclosure of this patent document contain material thatis subject to copyright protection. The copyright owner has no objectionto the facsimile reproduction by anyone of the patent document or thepatent disclosure as it appears in the Patent and Trademark Office fileor records, but otherwise reserves all copyright rights whatsoever.

BACKGROUND OF THE INVENTION

Three dimensional graphics processing applications require the storageand processing of large amounts of data. The time it takes to transferdata from memory to a graphics processor can negatively affect theability to process graphics data. There is a need to improve the abilityto quickly transfer graphics data from memory to processor. This problemcan be understood by reviewing the way that graphics systems processdata.

Computer systems are often used to display generate and display graphicson a display. Display images are made up of thousands of tiny dots,where each dot is one of thousands or millions of colors. These dots areknown as picture elements, or “pixels”. Each pixel has a color, with thecolor of each pixel being represented by a number value stored in thecomputer system.

A three dimensional display image, although displayed using a twodimensional array of pixels, may in fact be created by rendering of aplurality of graphical objects. Examples of graphical objects includepoints, lines, polygons, and three dimensional solid objects. Points,lines, and polygons represent rendering “primitives” which are the basisfor most rendering instructions. More complex structures, such as threedimensional objects, are formed from a combination or mesh of suchprimitives. To display a particular scene, the visible primitivesassociated with the scene are drawn individually by determining thosepixels that fall within the edges of the primitive, and obtaining theattributes of the primitive that correspond to each of those pixels. Theobtained attributes are used to determine the displayed color values ofapplicable pixels.

Sometimes, a three dimensional display image is formed from overlappingprimitives or surfaces. A blending function based on an opacity valueassociated with each pixel of each primitive is used to blend the colorsof overlapping surfaces or layers when the top surface is not completelyopaque. The final displayed color of an individual pixel may thus be ablend of colors from multiple surfaces or layers.

In some cases, graphical data is rendered by executing instructions froman application that is drawing data to a display. During imagerendering, three dimensional data is processed into a two dimensionalimage suitable for display. The three dimensional image data representsattributes such as color, opacity, texture, depth, and perspectiveinformation. The draw commands from a program drawing to the display mayinclude, for example, X and Y coordinates for the vertices of theprimitive, as well as some attribute parameters for the primitive (colorand depth or “Z” data), and a drawing command. The execution of drawingcommands to generate a display image is known as graphics processing.

A limitation of system performance is the bandwidth required to transferdata from memory to the graphics processor.

SUMMARY OF THE INVENTION

The present invention provides a scheme for compressing anddecompressing the depth, or Z, components of image data. Image data isgrouped into a plurality of tiles. A test is performed to determine if atile can be compressed so that its size after compression is less thanits size before compression. If so, the tile is compressed. A tile tableincludes a flag that can be set for each tile that is compressed. In adata transfer from memory to a graphics processor, the tile table isexamined to identify those tiles that are compressed and must bedecompressed prior to use.

In one scheme, each tile comprises a 4×4 block of pixels. For each pixelin the tile, the Z data is examined to determine the depth complexity.For instance, if there are seven overlapping primitives covering a tile,then the visible depth complexity might be seven. Variable compressionis applied to the tiles based on the depth complexity of the Z data. Ifthe depth complexity is relatively low, the data is highly compressed.As the depth complexity increases, the level of compression decreases,until a maximum depth complexity where there is effectively nocompression applied to the tiles.

In one embodiment, each level of depth complexity in a tile isconfigured to be stored as a plane equation. If a tile has a depthcomplexity level of one, a single plane equation is used. For lowerlevels of depth complexity, a single cache line might be used to storemultiple plane equations. As the depth complexity level increases, morecache lines are required for the plane equations and hence, the level ofcompression decreases.

If a tile is of maximum depth complexity, compression is not used.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows Z compression according to an embodiment of the presentinvention.

FIG. 2 shows Z compression according to another embodiment of thepresent invention.

FIG. 3 shows Z compression according to another embodiment of thepresent invention.

FIG. 4 is a flow diagram illustrating the compression of tiles andupdating of a TFT in the present invention.

FIG. 5 is a flow diagram illustrating the reading of a tile from memoryand the writing back of a tile to memory.

FIGS. 6A and 6B illustrate the high and low compression scheme datastructures of the present invention.

FIG. 7 illustrates Z compression using a variable compression mode andstencil buffer data according to an embodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

Compression and decompression of Z data using a variable compressionmode is described. In the following description, numerous specificdetails are set forth in order to provide a more thorough description ofthe invention. It will be apparent, however, to one skilled in the art,that the present invention may be practiced without these specificdetails. In other instances, well known details have not been providedso as to not unnecessarily obscure the invention.

The present invention provides for a compression scheme to reduce theamount of data that needs to be stored in memory. The compressed datacan be transferred from memory to processor at a higher bandwidth thanuncompressed data, improving performance. The invention also providesfor a method of decompressing the data at the processor. The compressionscheme of the invention is a lossless scheme so that no imageinformation is lost. The invention operates under the constraints thatthe compressed image data is less than or equal to the image datauncompressed, and that the bandwidth of transferring the compressedimage data is less than or equal to the bandwidth of the uncompressedimage data.

Data Organization

The invention organizes color images in 2 dimensional groups of pixelsreferred to as tiles. In one embodiment, the tiles are 4 pixels by 4pixels. Each tile, when used by a computing system is placed in a cache,where it is temporarily stored until used. A cache is a dedicated pieceof hardware that is designed for fast access to data that is likely tobe used by a computing system at some time in the near future. In oneembodiment, each cache line is 32 bytes. The cache is configured tostore compressed data, for instance one or more plane equations, foreach tile. Other configurations for the tiles and the cache may be usedwithout departing from the scope and spirit of the present invention.

Depth Complexity

Each tile may have graphical data from a number of primitives thatintersect in the tile. The surfaces of some of these primitives may bevisible and some may be hidden, depending on their relationship to eachother. The number of surfaces that are visible in a tile represents thevisible depth complexity of the tile. For example, if eight surfaces arevisible, the visible depth complexity of the tile is eight.

Plane Equations

A planar three dimensional surface (also referred to as a “primitive” ora “triangle”) can be defined by a plane equation. A plane equationallows the Z value at any point of a triangle or primitive to be definedby 3 values. One is the depth Z0 at the center of a 4×4 tile. The othervalues are dzx (change in Z value in the x direction) and dzy (change invalue in the y direction). Thus,Z=Z0+dxdzx+dydzy.

In one embodiment, each plane equation is defined using 65 bits. Fivebits are used for a common exponent, 17 bits are used as the mantissafor dzx and another 17 bits are used as the mantissa for dzy. 25 bitsare used for Z0 and one bit is a stencil bit.

Tile Compression

One embodiment of the present invention is shown in FIG. 1. At step 100,a tile is obtained. At step 110, the depth complexity of the tile isdetermined. At step 120, it is determined whether the depth complexityis relatively high. If it is, then at step 130 a low level or nocompression is applied to the Z data. If, on the other hand, the depthcomplexity is relatively low, then a high level of compression isapplied at step 140.

Another embodiment of the present invention is shown in FIG. 2. At step250, a tile is obtained. The tile may be a 4×4 grouping of pixels, or itmay be another suitable configuration. At step 260, the depth complexityof the tile is determined. At step 270, the depth complexity (and samplerate in a multisampling environment) is used to determine the number ofplane equations required to store the tile. At step 280, the tile isstored using the fewest cache lines needed to store the required numberof plane equations.

The present invention considers each tile to be written to memory as acandidate for compression. The invention determines whether thecompression of the tile would save memory or not and processes the tileaccordingly. As a result, each individual tile could be compressed oruncompressed. For instance, in variable compression mode, adetermination is made as to the depth complexity of a given tile. If thedepth complexity is maximal, then the number of plane equations requiredto represent the tile is maximal, so compression does not result insaving space when representing the tile in the cache. On the other hand,if the depth complexity is minimal, very little information is needed torepresent the tile, so a minimal number of plane equations need to beused to represent the tile. This results in relatively few planeequations that occupy relatively little cache space.

Variable Compression Mode

The present invention presumes that Z data is stored in cache lines in aZbuffer memory. Each tile in the Zbuffer memory can be read out orwritten as pixels, or in any one of a number of compressed formats(requiring fewer memory words to be accessed). The compression scheme ofthe present invention in one embodiment does not reduce the size of theZbuffer, only the number of cache lines used per Z tile. Compressedtiles reduce Z memory bandwidth in order to make more bandwidthavailable for other accesses, such as color and display, and therebyincrease system throughput.

In accordance with one embodiment of the present invention, compressionis performed on a 4×4 block of pixels (i.e., a tile). In one embodimentof the invention, there are two compression formats and an uncompressedformat available. The two compression formats comprise a first formatthat stores the tile in a single cache line and the second format storesthe tile in two cache lines. If the tile cannot be stored in two cachelines, it must be stored uncompressed.

Using two bit entries, four states of tile compression status can berepresented. In the invention, 00 represents a cleared state, 01represents the single cache line compression scheme, 10 represents thetwo cache line compression scheme, and 11 represents uncompressed data.Some of the conditions where the schemes are used are illustrated belowin Table 1.

TABLE 1 Bits per Sample Z bits Stencil Bits Sample Count TFT00 TFT 01TFT 10 TFT 11 16 16 0 1 cleared unused unused 1 line 16 16 0 2 clearedcomp1lines_16x2 comp2lines_16x2 2 lines 16 16 0 3 clearedcomp1lines_16x3 comp2lines_16x3 3 lines 16 16 0 4 clearedcomp1lines_16x4 comp2lines_16x4 4 lines 16 16 0 6 clearedcomp1lines_16x6 comp2lines_16x6 6 lines 32 24 8 1 clearedcomp1lines_32x1 comp2lines_32x1 2 lines 32 24 8 2 clearedcomp1lines_32x2 comp2lines_32x2 4 lines 32 24 8 3 clearedcomp1lines_32x3 comp2lines_32x3 6 lines 32 24 8 4 clearedcomp1lines_32x4 comp2lines_32x4 8 lines 32 24 8 6 clearedcomp1lines_32x6 comp2lines_32x6 12 lines

The number of Z bits, the visible depth complexity, and the number ofsamples determine the level of compression that can be used. The entrieslabeled TFT00, TFT01, TFT10, and TFT11 indicates the compression schemethat is used and the entries indicate how many cache lines are needed tostore the plane equation data. TFT 01 is the highest level ofcompression since only a single cache line is used, TFT 10 is a lowerlevel of compression since two cache lines are used, and TFT 11 is nocompression at all. TFT 11 shows the number of cache lines that arerequired when there is no compression.

Referring to the table, for instance, the first entry shows 16 Z bitsand a sample count of 1. With no compression, at all (TFT of 11), onecache line will be used. Since neither compression scheme can result inless than a single cache line, compression is unused in this case, as isshown by the table entries for TFT 01 and TFT 10. The TFT 10 compressionscheme results in two cache lines per tile and the TFT 01 scheme resultsin one cache line per tile. Referring to the last entry in the table 1with 32 bits per sample and a sample count of 6, 12 cache lines would berequired with no compression, while the TFT 10 compression scheme givesa 6:1 compression (only two cache lines are used) and the TFT 01compression scheme gives a 12:1 compression ratio with a single cacheline used instead of the 12 cache lines in the uncompressed mode.

It can be seen then that the present invention can be used in amultisampling environment and provides additional compression advantageswhen the sample size of each pixel increases. The same number of planeequations is used whether the sample size per pixel is 1, 2, 3, 4, or 6samples. Thus the invention provides advantages during multisampling.For example, if four plane equations results in 2× compression forsingle sampled data, then for four samples per pixel, there is 8×compression (eight cache lines would be needed for uncompressed mode)and for six samples, there is 12× compression, as shown above.

Tile Format Table (TFT)

The compression status of each tile could be stored in the tile itself.However, an uncompressed tile has no available space to indicate itsstatus as an uncompressed tile. In addition, at least the first word ofeach tile would need to be read to determine if it is compressed or not,reducing memory efficiency because reading the first word of a tilebefore making a decision about how many memory words to read would maketypical pipelined memory access difficult. To avoid these problems, thepresent invention includes a means of tracking the compression status ofeach tile via a Tile Format Table (TFT). The TFT includes an entry foreach tile. This is why the compression states described above werereferred to as, for example, TFT 01. When the tile is written to memory,its corresponding TFT entry is updated to indicate whether it iscompressed or not and which of the compression schemes 01, 10, or 11,was used.

Because the number of tiles in a typical image can be large, such as 64K4×4 tiles in a 2M pixel image, even with only a few compression statesstored in the TFT, the TFT memory can be significant, (as much as 4Kbytes). The TFT itself can be cached in the graphics processor andmaintained in memory to reduce on chip TFT storage. In this case agraphics memory access can update the TFT cache entry from the memoryTFT if the tile entry it requires is not in the cache. Updating the TFTcache can be pipelined with graphics processor compression anddecompression in conjunction with pipelined memory access. Typically theTFT cache entries are updated on memory read and therefore available forthe later memory write of the same tiles. A memory TFT with graphicsprocessor cache also simplifies providing access to the TFT by othersystem elements, insofar as the memory TFT is accessible by other systemelements.

A flow diagram of the compression of tiles and updating of the TFT inthe present invention is illustrated in FIG. 4. At step 401 the graphicsprocessor gets the next tile to be written to memory. At step 402 it isdetermined if after compression the compressed tile will be less than orequal to the uncompressed tile (i.e. the original tile). If not, thetile remains uncompressed at step 403. If the compressed tile would beless than or equal to the uncompressed tile the tile is compressed atstep 404 using one of the variable compression schemes contemplated bythe present invention. After either step 403 or 404, the tile is writtento memory at step 405. At step 406, the appropriate entry in the TFT isupdated to indicate the compressed/uncompressed status of the tile. Thesystem then returns to step 401.

High Compression Scheme

FIG. 6A shows several data structures for the fields of the TFT 01compression mode for unsampled and for different multisample values. TheTFT 01 compression scheme is a high compression scheme because theentire tile is stored in a single cache line. The beginning of each datastructure includes two bit pointers that indicates, for each pixel orpixel sample, the appropriate plane equation used to describe thesample. A tile is 4×4 pixels so for each tile there are 16 indexes pertile to indicate which plane equation is used when there is nomultisampling. Each additional sample requires an additional 16 two bitpointers. This means that with more samples, fewer plane equations canfit into a cache line. As seen in FIG. 6A, the data structure for theunsampled case allows three plane equations in the cache line. Formultisample situations of 2, 3, 4, and 6 samples per pixel, the size ofthe field needed to store the pointers means that only two planeequations can be stored in the cache line.

After the pointers in the data structure for this high compressionscheme are the plane equations (peq0, peq1, and peq2 for the unsampledcase, peq0 and peq1 for all others). Thus, in a multisampling situation,the high compression scheme can only be used when the visible depthcomplexity is no more than two, in other words, when only two visibleprimitives intersect the tile. In a single sample environment, a visibledepth complexity of up to three can be described in the high compressionscheme. If there are too many visible primitives, the low compressionscheme or the uncompressed scheme must be used.

Low Compression Scheme

FIG. 6B illustrates the data structures of the low compression schemewhere TFT is 10 and each tile is stored in two cache lines. Each ofthese structures is comprised of two cache lines. The first cache linein each pair comprises plane equations peq0, peq1, peq2, and part ofpeq3. The second cache line comprises the remainder of peq3 and forsamples 1, 2, and 3, an additional plane equation peq4 and the pointerfield. The 4 and 6 sample data structure requires so much space for thepointer field that there is no room for peq4 and only three planeequations are possible.

It can be seen that the low compression scheme is used when the visibledepth complexity is 3 or 4, depending on the number of samples perpixel.

It should be noted that the data structures of FIGS. 6A and 6B are givenby way of example only, and that other data structures and planeequation formats could be used without departing from the scope of thepresent invention.

Compression Operation

Compression operation using the plane equation scheme of the presentinvention is illustrated in FIG. 3. At step 300, a tile is obtained andexamined. At step 305 the pixels are examined one at a time. Each pixelcomes with a plane equation so at this point, it is assumed that thecurrent plane equation of the first pixel is peq0. Each pixel isretrieved and is examined to see if it has a different plane equationthan any plane equations that have currently been identified. If thereis a different plane equation a Z test is performed on the pixel to seeif it is visible. If it is visible then the depth complexity isincreased. If it is not visible, then the depth complexity remainswhatever it was based on the prior pixels. After all pixels have beenexamined it is known which pixels are visible and the depth complexityof the tile (i.e. how many plane equations are needed to describe thetile).

At decision block 310 it is determined if the depth complexity isgreater than 4. If yes, there is no compression and the tile is storeduncompressed at block 315. If no, then at decision block 320 it isdetermined if the depth complexity is less than or equal to 2. If so,then the high compression scheme is used at block 325 and the TFT tableis set to 10.

If the decision at block 320 is no, then at decision block 330 it isdetermined if the depth complexity is equal to 3. If so, then it is nextdetermined if the data is unsampled at decision block 335. If yes, thenthe high compression scheme can be used at block 340. If not, then thelow compression scheme must be used at block 345.

If the decision at block 330 is no, then the depth complexity must be 4based on the prior tests. Now it is required to know the number ofsamples per pixel to know if the low compression scheme can be used. Atdecision block 350 if the number of samples is less than or equal to 3,the low compression scheme can be used at block 355. If not, then thetile must be uncompressed at block 360.

Compression and Decompression During Memory Operations

In one embodiment, a tile may be decompressed into Z pixel data when thetile is read from memory for graphics processing and is compressed whenwritten back to memory. FIG. 5 is a flow diagram illustrating thereading of a tile from memory and the writing back of a tile to memory.At step 501 the tile is accessed from memory. At step 502 the TFT entryfor that tile is examined. At step 503 it is determined if the TFT entryindicates a compressed tile. If so, the tile is fetched and decompressedat step 504. If not, the tile is simply fetched at step 505. Aftereither step 504 or 505, the tile is used by the graphics processor atstep 506. When writing a tile back to memory, the TFT is again checkedat step 507 to see if the tile was a compressed tile. If so, the tile iscompressed at step 508. After step 508, or if the tile was not acompressed tile, it is written back to memory at step 509.

In another embodiment, the cache architecture itself is based on thecompressed Z format and tiles need not be uncompressed when being readfrom cache.

TFT Structure

The present invention contemplates the ability to apply different levelsof compression to each tile. If the number of plane equations requiredby a tile is less than the maximum number of plane equations, then thetile can be stored compressed.

Other system elements, such as a CPU or I/O controller, which access thecompressed images generated by the graphics processor, need to performdecompression and optionally compression. This means that the TFT is ashared system resource. The TFT can act as a shared resource by beingmultibuffered much like color images are multibuffered, that is, onecopy of the TFT accessed by the graphics processor during rendering oneimage, and another copy of the TFT accessed by other system elements foranother image.

Tile Caching

In a typical implementation, the graphics processor, anticipates imagetiles that it will process, reads memory words in advance of processing(prefetch), and buffers memory tiles it has completed processing inadvance of writing memory words. This pipelining of memory reads,graphics processing, and memory writes allows enough computing time toperform compression and decompression of the present invention inparallel with other processing. One implementation of pipelined memoryaccess and graphics processing is an image cache, in which tiles arecache lines which are read from memory on cache line misses and writtento memory on cache line evictions.

Stencil Buffer Data

Column 2 of Table 1 shows the use of stencil buffer data in the form ofstencil bits. A stencil bit corresponds to a state in a stencil buffer.A stencil buffer is a non-visual frame buffer comprising a logical bitfield that is used to mask certain screen regions. For instance, astencil buffer is often used for shadowing in a multi pass renderingalgorithm where the screen color is produced in stages. Certain shadowedscreen regions might change color differently and should be stenciledout in certain passes. The stencil bit in column 2 is used in thisembodiment as a ninth byte concatenated to the 8 byte plane equations.

FIG. 7 is a flowchart showing the operation of one embodiment of thepresent invention where a variable compression mode is used inconjunction with storing stencil buffer data. At step 700, a tile isobtained. The tile may be a 4×4 grouping of pixels, or it may be anothersuitable configuration. At step 710, the depth of the Z data pixels inthe tile are determined. At step 720, the maximum depth is used todetermine the number of plane equations required to store the tile. Atstep 730, stencil buffer data for the tile is obtained. At step 740, thestencil buffer data is incorporated into the plane equations. Then, atstep 750, the plane equations having stencil buffer data are placed intothe cache.

A computer program product includes a non-transitory computer usablemedium having computer readable program code embodied therein configuredfor compressing data in a graphics processing system. The computerprogram product includes computer readable code configured to cause acomputer to obtain a data tile. The computer program product alsoincludes computer readable code configured to cause a computer determinea visible depth complexity of the tile. The computer program productfurther includes computer readable code configured to cause a computerto select a compression scheme based on the depth complexity. Thecomputer program product still further includes computer readable codeconfigured to cause a computer to store in a cache having at least onecache line using the selected compression scheme, wherein the number ofcache lines storing the tile depends on the selected compression scheme.

The advantage of the invention is that bandwidth improvement forexisting applications is achieved and performance is never worse than anuncompressed Zbuffer. Furthermore, there is a synergy between compressedZ and Z caches in that areas of high geometric complexity (smallpolygons) benefit from the multiple hit write combining performance ofthe Z cache even if tiles don't compress, and areas of low geometriccomplexity (big polygons) compress well even if cache line pixels areonly written once per miss and eviction. Because the compression isbased on pixel masks, functions like alpha threshholding and virtualintersections can also be compressed. A secondary advantage of Zcompression is that translucent pixels that test but don't update Z donot decrease the amount of Z compression, so effects like particles,smoke, shadows, weapons flares, etc. which blend on top of opaque Zbuffers can have unlimited geometric pixel complexity without increasingZ bandwidth.

The above-described compression schemes are described in conjunctionwith an overall system for compressing and decompressing data in agraphics system. One such system is described in further detail inco-pending U.S. patent application entitled “Method and Apparatus forCompression and Decompression of Z data” application Ser. No.09/653,055, filed on Sep. 1, 2000, assigned to the assignee of thepresent application, and hereby fully incorporated into the presentapplication by reference.

Thus, compression and decompression of Z data using a variablecompression mode is described in conjunction with one or more specificembodiments. The invention is defined by the claims and their full scopeof equivalents.

1. A method of compressing data in a graphics processing systemcomprising: obtaining a data tile; determining a visible depthcomplexity of said tile; selecting a compression scheme based on saiddepth complexity; and storing said tile in a cache having at least onecache line using said selected compression scheme, wherein the number ofcache lines storing the tile depends on the selected compression scheme.2. The method of claim 1 wherein no compression is selected if saiddepth complexity exceeds a threshold.
 3. The method of claim 1, whereineach level of depth complexity is represented by a plane equation, andwherein a number of plane equations are stored in the cache depending ona level of visible depth complexity.
 4. The method of claim 3 whereinmultiple plane equations are stored in a cache line.
 5. The method ofclaim 4 wherein said selected compression scheme comprises one of a highcompression scheme and a low compression scheme.
 6. The method of claim5 wherein no more than three plane equations are stored in a cache linein said high compression scheme.
 7. The method of claim 5 wherein nomore than four plane equations are stored in two cache lines in said lowcompression scheme.
 8. The method of claim 4 wherein cache lines includea matrix identifying which plane equation is associated with each pixelof said tile.
 9. The method of claim 3 wherein said plane equationincludes one or more bits of stencil data.
 10. The method of claim 1wherein said tiles comprise a 4×4 block of pixels.
 11. The method ofclaim 10 wherein said pixels represent Z data.
 12. The method of claim 1wherein said tile comprises multisampled pixel data.
 13. A computerprogram product comprising: a non-transitory computer usable mediumhaving computer readable program code embodied therein configured forcompressing data in a graphics processing system, said computer programproduct comprising: computer readable code configured to cause acomputer to obtain a data tile; computer readable code configured tocause a computer determine a visible depth complexity of said tile;computer readable code configured to cause a computer to select acompression scheme based on said depth complexity; and computer readablecode configured to cause a computer to store in a cache having at leastone cache line using said selected compression scheme, wherein thenumber of cache lines storing the tile depends on the selectedcompression scheme.
 14. The computer program product of claim 13 whereinsaid computer program product causes said computer to select nocompression scheme if said depth complexity exceeds a threshold.
 15. Thecomputer program product of claim 13, wherein each level of depthcomplexity is represented by a plane equation, and wherein a number ofplane equations are stored in the cache depending on a level of visibledepth complexity.
 16. The computer program product of claim 15 whereinsaid multiple plane equations are stored in a cache line.
 17. Thecomputer program product of claim 16 wherein said selected compressionscheme comprises one of a high compression scheme and a low compressionscheme.
 18. The computer program product of claim 17 wherein no morethan three plane equations are stored in a single cache line in saidhigh compression scheme.
 19. The computer program product of claim 17wherein no more than four plane equations are stored in two cache linesin said low compression scheme.
 20. The computer program product ofclaim 16 wherein cache lines include a matrix identifying which planeequation is associated with each pixel of said tile.
 21. The computerprogram product of claim 15 wherein said plane equation includes one ormore bits of stencil data.
 22. The computer program product of claim 13wherein said tiles comprise a 4×4 block of pixels.
 23. The computerprogram product of claim 22 wherein said pixels represent Z data. 24.The computer program product of claim 13 wherein said tile comprisesmultisampled pixel data.